
(function(){
    window.page=window.page||{};
    page.initManager=new util.factory([]);
    $(function(){

        function url(e){
            var thisObj=this;
            var url=FeishiUtil.getRootUrl()+"/"+this.dataset.url;
            var target=this.dataset.target||"_self";
            condition.checkElement.call(this,"url",function(){
                FeishiUtil.postUrl(url,target);
            })
        }
        function operation(e){
            var thisObj=this;
            if(e.target!=this&&e.target.dataset.nottrans=='true'){
                return;
            }
            if(!this.dataset.operation){
                console.log("the div",this,"has no target execute function!");
                return;
            }
            condition.checkElement.call(this,"url",function(){
                page.initManager.execute(this.dataset.operation,this.dataset.param,this);
            })
        }
        $("body").on("click",".operation",operation);
        $("body").on("click",".url",url);
        page.initManager.add(operation,"operation");
        page.initManager.add(url,"url");
    })
})();
